@page
@{ Layout = "_Layout"; }
@section Styles{
  <style>
    .uploader {display:inline-block;}
  </style>
}

<el-table :data="forms">
  <el-table-column label="表单名称" width="280">
    <template slot-scope="scope">
      <el-link
        :underline="false"
        type="primary"
        :disabled="isDisabled(scope.row)"
        v-on:click="btnViewClick(scope.row)">
        {{ scope.row.title }}
      </el-link>
    </template>
  </el-table-column>
  <el-table-column prop="description" label="表单简介"></el-table-column>
  <el-table-column prop="createdDate" label="添加日期" width="160"></el-table-column>
  <el-table-column label="操作" width="220">
    <template slot-scope="scope">
      <el-link
        :underline="false"
        style="margin-right: 5px;"
        v-on:click="btnUpClick(scope.row)"
        type="primary">
        上 升
      </el-link>
      <el-link
        :underline="false"
        style="margin-right: 5px;"
        v-on:click="btnDownClick(scope.row)"
        type="primary">
        下 降
      </el-link>
      <el-link
        :underline="false"
        style="margin-right: 5px;"
        v-on:click="btnEditClick(scope.row)"
        type="primary">
        编 辑
      </el-link>
      <el-link
        :underline="false"
        style="margin-right: 5px;"
        v-on:click="btnExportClick(scope.row)"
        type="primary">
        导 出
      </el-link>
      <el-link
        :underline="false"
        type="danger"
        v-on:click="btnDeleteClick(scope.row)">
        删 除
      </el-link>
    </template>
  </el-table-column>
</el-table>

<div style="height: 10px"></div>
<el-divider></el-divider>
<div style="height: 10px"></div>

<el-button
  size="small"
  type="primary"
  v-on:click="btnAddClick">
  新增表单
</el-button>

<el-upload
  class="uploader"
  :action="urlUpload"
  :headers="{Authorization: 'Bearer ' + $token}"
  :show-file-list="false"
  :drag="false"
  :limit="1"
  :before-upload="uploadBefore"
  :on-progress="uploadProgress"
  :on-success="uploadSuccess"
  :on-error="uploadError"
  :multiple="false">
  <el-button
    size="small"
    type="default">
    导入表单
  </el-button>
</el-upload>

@section Scripts{
  <script src="/sitefiles/assets/js/admin/cms/formList.js" type="text/javascript"></script>
}
